<template>
  <div class="app-loading" v-if="!isReady">
    <app-loading></app-loading>
  </div>
  <router-view />
</template>

<script lang="ts">
import { defineComponent } from "vue";
export default defineComponent({
  nam: "App",
})
</script>

<script lang="ts" setup>
import { ref, onMounted } from "vue";
import AppLoading from "@/views/app/AppLoading";
import { useRouter } from "vue-router";
import { APP_TITLE } from "@/config";

let router = useRouter();



/**
 * 路由是否加载成功
 */
let isReady = ref(false);

router.isReady()
  .then(() => {
    isReady.value = true;
  })


onMounted(() => {
  document.title = APP_TITLE;
})
</script>

<style lang="less" scoped>
.app-loading {
  position: fixed;
  width: 100vw;
  height: 100vh;
  top: 0;
  left: 0;
}
</style>